package io.p2p.stream.stun.model;

import io.p2p.stream.stun.service.StunUdpServer;
import io.p2p.stream.stun.util.PropertiesUtil;
import java.util.Properties;

public class StunSharedModel {
    private static final String CONFIG_FILE = "config-dev.properties";

    public static String stunServerName = null;

    public static String mainServerFirstIP = null;

    public static int mainServerFirstPort = 0;

    public static String stunServerFirstIP = null;

    public static int stunServerFirstPort = 0;

    public static String stunServerSecondIP = null;

    public static int stunServerSecondPort = 0;

    public static StunUdpServer firstStunUdpServer;
    public static StunUdpServer secondStunUdpServer;

    static {
        Properties config = PropertiesUtil.loadConfig(CONFIG_FILE);

        stunServerName = config.getProperty("stun.server.name","stun1");

        mainServerFirstIP = config.getProperty("udp.main.server.first.ip", "127.0.0.1");
        mainServerFirstPort = Integer.parseInt(config.getProperty("udp.main.server.first.port", "52002"));

        stunServerFirstIP = config.getProperty("udp.stun.server.first.ip", "127.0.0.1");
        stunServerFirstPort = Integer.parseInt(config.getProperty("udp.stun.server.first.port", "52001"));

        stunServerSecondIP = config.getProperty("udp.stun.server.second.ip", "127.0.0.1");
        stunServerSecondPort = Integer.parseInt(config.getProperty("udp.stun.server.second.port", "52002"));
    }
}
